import json

 
#-----------读取图片json文件----------------------
image_annotation_path = '/data/train/image_annotation/050960/0.json'

with open(image_annotation_path,'r') as load_f:
    load_dict = json.load(load_f)
    
for i in load_dict['annotations']:
    print('-----------------------------------------')
    print(i)
    print(i['box'])
    print(i['label'])
    


#------------读取视频json文件-----------------------
video_annotation_path = '/data/train/video_annotation/050960.json'

with open(video_annotation_path, 'r') as load_f:
    load_dict = json.load(load_f)


# print(load_dict['frames'][0]['annotations'])

for i in load_dict['frames']:
    print('-----------------------------------------')
    print(i)
    for j in i['annotations']:
        print(j['box'])
        print(j['label'])
#         print(j['viewpoint'])
#         print(j['display'])
    
